package com.bw.liuyushan.zhuangao4_weektest2.DaoSQL;

import android.database.sqlite.SQLiteDatabase;

import com.bw.liuyushan.zhuangao4_weektest2.App.App;

/**
 * ZhuanGao4_WeekTest2
 * file name is : VideoMsgUtils
 * created by Ender on 2021/8/25 16:44.
 * author : 刘雨杉
 * Describe(作用):
 */
public class VideoMsgUtils {
    private static VideoMsgUtils videoMsgUtils;

    public static VideoMsgUtils getInstance() {
        if (videoMsgUtils==null){
            videoMsgUtils=new VideoMsgUtils();
        }
        return videoMsgUtils;
    }
    private static DaoSession daoSession;

    private VideoMsgUtils() {
        DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(App.context, "VideoMsg.db");
        SQLiteDatabase writableDatabase = devOpenHelper.getWritableDatabase();
        DaoMaster daoMaster = new DaoMaster(writableDatabase);
        daoSession=daoMaster.newSession();
    }

    public  VideoDao getDaoSession() {
        return daoSession.getVideoDao();
    }
}
